﻿@{
    ViewBag.Title = Local("SiteSettingsManagement");
}

@model SiteSettings

@using (Html.BeginForm())
{
<div id="tabs">
    <ul>
        <li><a href="#tabs-1">@Local("SiteSettings.BasicSettings")</a></li>
        <li><a href="#tabs-2">@Local("SiteSettings.EmailSettings")</a></li>
        @if (Model.IsDefault)
        {
        <li><a href="#tabs-3">@Local("SiteSettings.UserSettings")</a></li>
        <li><a href="#tabs-4">@Local("SiteSettings.DenyNamesSettings")</a></li>
        }
    </ul>
    <div id="tabs-1">
        <div class="box">
            <label>@Local("SiteSettings.SiteDomain")</label>
            <div class="right">
                <input type="text" name="SiteDomain" value="@Model.SiteDomain" readonly="readonly" />
            </div>
        </div>

        <div class="box">
            <label>@Local("SiteSettings.SiteName")</label>
            <div class="right">
                <input type="text" name="SiteName" value="@Model.SiteName" />
            </div>
        </div>

        <div class="box">
            <label>@Local("SiteSettings.LogExpiredDays")</label>
            <div class="right">
                <input type="text" name="LogExpiredDays" value="@Model.LogExpiredDays" />
            </div>
        </div>

        <div class="box">
            <h3>@Local("SiteSettings.Copyright")</h3>
            <textarea name="Copyright">@Model.Copyright</textarea>
        </div>

        <div class="box">
            <label>@Local("SiteSettings.IcpCode")</label>
            <div class="right">
                <input type="text" name="IcpCode" value="@Model.IcpCode" />
            </div>
        </div>

        <div class="box">
            <label>@Local("SiteSettings.Language")</label>
            <div class="right">
                @Html.DropdownListForResource(model=>model.Language)
            </div>
        </div>

        <div class="box">
            <label>@Local("SiteSettings.Theme")</label>
            <div class="right">
                @Html.DropdownListForTheme(model => model.Theme)
            </div>
        </div>

        @if (Model.IsDefault)
        {
        <div class="box">
            <label>@Local("SiteSettings.PageMode")</label>
            <div class="right">
                @Html.DropdownListForEnum(m => m.PageMode, null, Controller, AreaName)
                <div class="summary">@Local("SiteSettings.PageMode.Summary")</div>
            </div>
        </div>
        }
        <div class="box">
            <label>@Local("SiteSettings.DateFormat")</label>
            <div class="right">
                @Html.DropdownListForDateFormat(m => m.DateFormat)
            </div>
        </div>

        <div class="box">
            <label>@Local("SiteSettings.TimeFormat")</label>
            <div class="right">
                @Html.DropdownListForTimeFormat(m => m.TimeFormat)
            </div>
        </div>

        <div class="box">
            <label>@Local("SiteSettings.TimeZone")</label>
            <div class="right">
                @Html.DropdownListForTimeZone(m => m.TimeZone)
            </div>
        </div>

        <div class="box">
            <label>@Local("SiteSettings.MetaKeyWords")</label>
            <div class="right">
                <input type="text" name="MetaKeyWords" style="width:100%;" value="@Model.MetaKeyWords" />
            </div>
        </div>

        <div class="box">
            <h3>@Local("SiteSettings.MetaDescription")</h3>
            <textarea name="MetaDescription">@Model.MetaDescription</textarea>
        </div>

        <div class="box">
            <h3>@Local("SiteSettings.Analyzer")</h3>
            <textarea name="Analyzer">@Model.Analyzer</textarea>
        </div>
    </div>

    <div id="tabs-2">
        <div class="box">
            <label>@Local("SiteSettings.WebMail")</label>
            <div class="right">
                @Html.TextBoxFor(model=>model.WebMail)
            </div>
        </div>
        <div class="box">
            <label>@Local("SiteSettings.DisplayName")</label>
            <div class="right">
                @Html.TextBoxFor(model=>model.DisplayName)
            </div>
        </div>
        <div class="box">
            <label>@Local("SiteSettings.SmtpHost")</label>
            <div class="right">
                @Html.TextBoxFor(model=>model.SmtpHost)
            </div>
        </div>
        <div class="box">
            <label>@Local("SiteSettings.SmtpPort")</label>
            <div class="right">
                @Html.TextBoxFor(model=>model.SmtpPort)
            </div>
        </div>
        <div class="box">
            <label>@Local("SiteSettings.SmtpUserName")</label>
            <div class="right">
                @Html.TextBoxFor(model=>model.SmtpUserName)
            </div>
        </div>
        <div class="box">
            <label>@Local("SiteSettings.SmtpPassword")</label>
            <div class="right">
                @Html.TextBoxFor(model=>model.SmtpPassword)
            </div>
        </div>
        <div class="box">
            <label>@Local("SiteSettings.UseNtlmCredentials")</label>
            <div class="right">
                @Html.CheckBoxFor(model=>model.UseNtlmCredentials)
            </div>
        </div>
        <div class="box">
            <label>@Local("SiteSettings.RequiresLogin")</label>
            <div class="right">
                @Html.CheckBoxFor(model=>model.RequiresLogin)
            </div>
        </div>
        <div class="box">
            <label>@Local("SiteSettings.SubjectEncoding")</label>
            <div class="right">
                @Html.TextBoxFor(model=>model.SubjectEncoding)
            </div>
        </div>
        <div class="box">
            <label>@Local("SiteSettings.BodyEncoding")</label>
            <div class="right">
                @Html.TextBoxFor(model=>model.BodyEncoding)
            </div>
        </div>
        <div class="box">
            <label>@Local("SiteSettings.MaxTryTimes")</label>
            <div class="right">
                @Html.TextBoxFor(model=>model.MaxTryTimes)
            </div>
        </div>
        <div class="box">
            <label>@Local("SiteSettings.FailureInterval")</label>
            <div class="right">
                @Html.TextBoxFor(model=>model.FailureInterval)
                <div class="summary">@Local("SiteSettings.FailureInterval.Summary")</div>
            </div>
        </div>
        <div class="box">
            <label>@Local("SiteSettings.EachDequeueSize")</label>
            <div class="right">
                @Html.TextBoxFor(model=>model.EachDequeueSize)
                <div class="summary">@Local("SiteSettings.EachDequeueSize.Summary")</div>
            </div>
        </div>
    </div>

    @if (Model.IsDefault) { 
    <div id="tabs-3">
        <div class="box">
            <label>@Local("SiteSettings.EncryptType")</label>
            <div class="right">@Html.DropdownListForEnum(model=>model.EncryptType, null, Controller, AreaName)</div>
        </div>
        <div class="box">
            <label>@Local("SiteSettings.AnonymousCookieName")</label>
            <div class="right winput">@Html.TextBoxFor(model=>model.AnonymousCookieName)</div>
        </div>
        <div class="box">
            <label>@Local("SiteSettings.AnonymousCookieExpiration")</label>
            <div class="right">@Html.TextBoxFor(model=>model.AnonymousCookieExpiration)</div>
        </div>
        <div class="box">
            <label>@Local("SiteSettings.CookieDomain")</label>
            <div class="right">@Html.TextBoxFor(model=>model.CookieDomain)</div>
        </div>
        <div class="box">
            <label>@Local("SiteSettings.QuestionAnswer")</label>
            <div class="right">
                @Html.CheckBoxFor(model=>model.QuestionAnswer)
                <div class="summary">@Local("SiteSettings.QuestionAnswer.Summary")</div>
            </div>
        </div>
        <div class="box">
            <label>@Local("SiteSettings.AllowLogin")</label>
            <div class="right">@Html.CheckBoxFor(model=>model.AllowLogin)</div>
        </div>
        <div class="box">
            <label>@Local("SiteSettings.EnableBannedUsersToLogin")</label>
            <div class="right">@Html.CheckBoxFor(model=>model.EnableBannedUsersToLogin)</div>
        </div>
        <div class="box">
            <label>@Local("SiteSettings.AllowAvatarExtensions")</label>
            <div class="right winput">@Html.TextBoxFor(model=>model.AllowAvatarExtensions)</div>
        </div>
        <div class="box">
            <label>@Local("SiteSettings.AvatarWidth")</label>
            <div class="right">@Html.TextBoxFor(model=>model.AvatarWidth)</div>
        </div>
        <div class="box">
            <label>@Local("SiteSettings.AvatarHeight")</label>
            <div class="right">@Html.TextBoxFor(model=>model.AvatarHeight)</div>
        </div>
        <div class="box">
            <label>@Local("SiteSettings.UserNameRegex")</label>
            <div class="right winput">@Html.TextBoxFor(model=>model.UserNameRegex)</div>
        </div>
        <div class="box">
            <label>@Local("SiteSettings.UserNameRegexDescription")</label>
            <div class="right winput">@Html.TextBoxFor(model=>model.UserNameRegexDescription)</div>
        </div>
        <div class="box">
            <label>@Local("SiteSettings.UniqueEmail")</label>
            <div class="right">@Html.CheckBoxFor(model=>model.UniqueEmail)</div>
        </div>
        <div class="box">
            <label>@Local("SiteSettings.PasswordRegex")</label>
            <div class="right winput">@Html.TextBoxFor(model=>model.PasswordRegex)</div>
        </div>
        <div class="box">
            <label>@Local("SiteSettings.PasswordRegexDescription")</label>
            <div class="right winput">@Html.TextBoxFor(model=>model.PasswordRegexDescription)</div>
        </div>
        <div class="box">
            <label>@Local("SiteSettings.SendEmail")</label>
            <div class="right">@Html.CheckBoxFor(model=>model.SendEmail)</div>
        </div>
        <div class="box">
            <label>@Local("SiteSettings.AccountActivation")</label>
            <div class="right">@Html.DropdownListForEnum(model=>model.AccountActivation, null, Controller, AreaName)</div>
        </div>
        <div class="box">
            <label>@Local("SiteSettings.InitationKeyExpiredDays")</label>
            <div class="right">@Html.TextBoxFor(model=>model.InitationKeyExpiredDays)</div>
        </div>
        <div class="box">
            <label>@Local("SiteSettings.MaxFailedPasswordAttemptCount")</label>
            <div class="right">@Html.TextBoxFor(model=>model.MaxFailedPasswordAttemptCount)</div>
        </div>
        <div class="box">
            <label>@Local("SiteSettings.MaxFailedPasswordAnswerAttemptCount")</label>
            <div class="right">@Html.TextBoxFor(model=>model.MaxFailedPasswordAnswerAttemptCount)</div>
        </div>
        <div class="box">
            <label>@Local("SiteSettings.FailedPasswordAttemptWindowTimeout")</label>
            <div class="right">
                @Html.TextBoxFor(model=>model.FailedPasswordAttemptWindowTimeout)
                <div class="summary">@Local("SiteSettings.FailedPasswordAttemptWindowTimeout.Summary")</div>
            </div>
        </div>
        <div class="box">
            <label>@Local("SiteSettings.FailedPasswordAnswerAttemptWindowTimeout")</label>
            <div class="right">
                @Html.TextBoxFor(model=>model.FailedPasswordAnswerAttemptWindowTimeout)
                <div class="summary">@Local("SiteSettings.FailedPasswordAnswerAttemptWindowTimeout.Summary")</div>
            </div>
        </div>
    </div>
        
    <div id="tabs-4">
        <div class="box">
            <h3>@Local("SiteSettings.DenyNames")</h3>
            @Html.TextAreaFor(model => model.DenyNames, new { @class = "h500" })
            <div class="summary">@Local("SiteSettings.DenyNames.Summary")</div>
        </div>
    </div>
    }
</div>

<div class="box">
    <button> @Local("SiteSettings.Save") </button>
</div>
}